using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._ProjectionsandTransformations
{
    /// <summary>
    /// <para>Project</para>
    /// <para>Projects spatial data from one coordinate system to another.</para>
    /// <para>将空间数据从一个坐标系投影到另一个坐标系。</para>
    /// </summary>    
    [DisplayName("Project")]
    public class Project : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public Project()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_dataset">
        /// <para>Input Dataset or Feature Class</para>
        /// <para>The feature class, feature layer, feature dataset, scene layer, or scene layer package to be projected.</para>
        /// <para>要投影的要素类、要素图层、要素数据集、场景图层或场景图层包。</para>
        /// </param>
        /// <param name="_out_dataset">
        /// <para>Output Dataset or Feature Class</para>
        /// <para>The output dataset to which the results will be written.</para>
        /// <para>将结果写入的输出数据集。</para>
        /// </param>
        /// <param name="_out_coor_system">
        /// <para>Output Coordinate System</para>
        /// <para>The coordinate system to which the input data will be projected.</para>
        /// <para>输入数据将投影到的坐标系。</para>
        /// </param>
        public Project(object _in_dataset, object _out_dataset, object _out_coor_system)
        {
            this._in_dataset = _in_dataset;
            this._out_dataset = _out_dataset;
            this._out_coor_system = _out_coor_system;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Project";

        public override string CallName => "management.Project";

        public override List<string> AcceptEnvironments => ["XYResolution", "XYTolerance", "maintainAttachments", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_dataset, _out_dataset, _out_coor_system, _transform_method, _in_coor_system, _preserve_shape.GetGPValue(), _max_deviation, _vertical.GetGPValue()];

        /// <summary>
        /// <para>Input Dataset or Feature Class</para>
        /// <para>The feature class, feature layer, feature dataset, scene layer, or scene layer package to be projected.</para>
        /// <para>要投影的要素类、要素图层、要素数据集、场景图层或场景图层包。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Dataset or Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_dataset { get; set; }


        /// <summary>
        /// <para>Output Dataset or Feature Class</para>
        /// <para>The output dataset to which the results will be written.</para>
        /// <para>将结果写入的输出数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Dataset or Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_dataset { get; set; }


        /// <summary>
        /// <para>Output Coordinate System</para>
        /// <para>The coordinate system to which the input data will be projected.</para>
        /// <para>输入数据将投影到的坐标系。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Coordinate System")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_coor_system { get; set; }


        /// <summary>
        /// <para>Geographic Transformation</para>
        /// <para><xdoc>
        ///   <para>This method can be used to convert data between two geographic coordinate systems or datums. This optional parameter may be required if the input and output coordinate systems have different datums.</para>
        ///   <para>The tool automatically selects a default transformation. You can choose a different transformation from the drop-down list. Transformations are bidirectional. For example, if you're converting data from WGS 1984 to NAD 1927, you can choose a transformation called NAD_1927_to_WGS_1984_3, and the tool will apply it correctly.</para>
        ///   <para>The parameter provides a drop-down list of valid transformation methods. See the usage tips for further information on how to choose one or more appropriate transformations.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>此方法可用于在两个地理坐标系或基准面之间转换数据。如果输入坐标系和输出坐标系具有不同的基准面，则可能需要此可选参数。</para>
        ///   <para>该工具会自动选择默认变换。您可以从下拉列表中选择其他转换。转换是双向的。例如，如果要将数据从 WGS 1984 转换为 NAD 1927，则可以选择名为 NAD_1927_to_WGS_1984_3 的转换，该工具将正确应用它。</para>
        ///   <para>该参数提供有效转换方法的下拉列表。有关如何选择一个或多个适当转换的更多信息，请参阅使用提示。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Geographic Transformation")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _transform_method { get; set; } = null;


        /// <summary>
        /// <para>Input Coordinate System</para>
        /// <para>The coordinate system of the input feature class or dataset. This parameter becomes active when the input has an unknown or unspecified coordinate system. This allows you to specify the data's coordinate system without having to modify the input data (which may not be possible if the input is in read-only format).</para>
        /// <para>输入要素类或数据集的坐标系。当输入具有未知或未指定的坐标系时，此参数将变为活动状态。这允许您指定数据的坐标系，而无需修改输入数据（如果输入为只读格式，则可能无法修改）。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Coordinate System")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_coor_system { get; set; } = null;


        /// <summary>
        /// <para>Preserve Shape</para>
        /// <para><xdoc>
        ///   <para>Specifies whether vertices will be added to the output lines or polygons so their projected shape is more accurate.</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>Unchecked—Extra vertices will not be added to the output lines or polygons. This is the default.</bullet_item><para/>
        ///       <bullet_item>Checked—Extra vertices will be added to the output lines or polygons, as needed, so their projected shape is more accurate.</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否将顶点添加到输出线或多边形中，以便其投影形状更准确。</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>未选中 - 不会将额外折点添加到输出线或面中。这是默认设置。</bullet_item><para/>
        ///       <bullet_item>选中 - 将根据需要将额外的折点添加到输出线或面中，以便其投影形状更加准确。</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Preserve Shape")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _preserve_shape_value _preserve_shape { get; set; } = _preserve_shape_value._false;

        public enum _preserve_shape_value
        {
            /// <summary>
            /// <para>PRESERVE_SHAPE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("PRESERVE_SHAPE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_PRESERVE_SHAPE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_PRESERVE_SHAPE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Maximum Offset Deviation</para>
        /// <para>The distance a projected line or polygon can deviate from its exact projected location when the Preserve Shape parameter is checked. The default is 100 times the x,y tolerance of the spatial reference of the output dataset.</para>
        /// <para>选中“保留形状”参数时，投影线或面可能偏离其确切投影位置的距离。默认值为输出数据集空间参考的 x，y 容差的 100 倍。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Offset Deviation")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _max_deviation { get; set; } = null;


        /// <summary>
        /// <para>Vertical</para>
        /// <para><xdoc>
        ///   <para>Specifies whether a vertical transformation will be applied.</para>
        ///   <para>The parameter is only active when the input and output coordinate systems have a vertical coordinate system and the input feature class coordinates have z-values. Also, many vertical transformations require additional data files that must be installed using the ArcGIS Coordinate Systems Data installation package.</para>
        ///   <para>When Vertical is checked, the Geographic Transformation parameter can include ellipsoidal transformations and transformations between vertical datums. For example, ~NAD_1983_To_NAVD88_CONUS_GEOID12B_Height + NAD_1983_To_WGS_1984_1 transforms geometry vertices that are defined on NAD 1983 datum with NAVD 1988 heights into vertices on the WGS 1984 ellipsoid (with z-values representing ellipsoidal heights). The tilde (~) indicates the reversed direction of transformation.</para>
        ///   <para>This parameter is not compatible with the Preserve Shape parameter.</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>Unchecked—No vertical transformation will be applied. The z-values of geometry coordinates will be ignored and the z-values will not be modified. This is the default.</bullet_item><para/>
        ///       <bullet_item>Checked—The transformation specified in the Geographic Transformation parameter will be applied. The Project tool transforms x-, y-, and z-values of geometry coordinates.</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否应用垂直转换。</para>
        ///   <para>仅当输入和输出坐标系具有垂直坐标系且输入要素类坐标具有 z 值时，该参数才处于活动状态。此外，许多垂直变换需要额外的数据文件，这些文件必须使用 ArcGIS 坐标系数据安装包进行安装。</para>
        ///   <para>选中“垂直”（Vertical） 后，地理变换参数可以包括椭球体变换和垂直基准面之间的变换。例如，~NAD_1983_To_NAVD88_CONUS_GEOID12B_Height + NAD_1983_To_WGS_1984_1 将高度为 NAVD 1988 的 NAD 1983 基准面上定义的几何顶点转换为 WGS 1984 椭球体上的顶点（z 值表示椭球体高度）。波浪号 （~） 表示转换的反向。</para>
        ///   <para>此参数与“保留形状”参数不兼容。</para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>未选中 - 将不应用垂直变换。几何坐标的 z 值将被忽略，并且不会修改 z 值。这是默认设置。</bullet_item><para/>
        ///       <bullet_item>选中—将应用地理变换参数中指定的变换。投影工具可变换几何坐标的 x、y 和 z 值。</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Vertical")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _vertical_value _vertical { get; set; } = _vertical_value._false;

        public enum _vertical_value
        {
            /// <summary>
            /// <para>VERTICAL</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("VERTICAL")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_VERTICAL</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_VERTICAL")]
            [GPEnumValue("false")]
            _false,

        }

        public Project SetEnv(object XYResolution = null, object XYTolerance = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(XYResolution: XYResolution, XYTolerance: XYTolerance, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}